<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script src="http://cdn.static.runoob.com/libs/jquery/1.10.2/jquery.min.js"></script>
		<style type="text/css">
			.test{background-color: red;height: 300px;}
		</style>
	</head>
	<body>
		<div class="test">
			ss
		</div>
		<button>测试</button>
	
		<script>
			/*
			 *1.为了判断元素是否显示.可以以is来判断，如果内容显示则.is(":visible") 
			 * 
			 * */
			$(function(){
				
				$("button").click(function(){
					if($(".test").is(":visible")){
						$(".test").hide();
					}else{
						$(".test").show();
					}
					
				})
				
				
				
			})
			
			
			
			
		</script>
	</body>
</html>
